import {baseRequest} from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/air/${url}`, ...arg)
const nftRequest = (url, ...arg) => baseRequest(`/nft/${url}`, ...arg)

/**
 * 管理端空投活动Api接口管理器
 *
 * @author zhangkaige
 * @date  2024/01/26
 **/
export default {
	//藏品下拉框
	nftSelect(pageNo, PageSize, type) {
		return nftRequest(`${pageNo}/${PageSize}/select.do`, {type: type}, "post")
	},
	// 添加空投信息
	addAirInfo(data) {
		return request('addAirInfo.do', data, 'post')
	},
	// 执行空投活动
	exeAirdrop(airId) {
		return request(`${airId}/exeAirdrop.do`, null, 'get')
	},
	// 删除空投活动
	deleteAirdrop(airId) {
		return request(`${airId}/deleteAirdrop.do`, null, 'get')
	},
	// 分页查询空投信息
	pageAirInfo(pageNo, pageSize, data) {
		return request(`${pageNo}/${pageSize}/pageAirInfo.do`, data, 'post')
	},
	// 查看空投信息
	getAirInfo(airId) {
		return request(`${airId}/getAirInfo.do`, null, 'get')
	},
	// 获取移动端菜单详情
	mobileMenuDetail(data) {
		return request('detail', data, 'get')
	},
	// 更新空投信息
	updateAirInfo(data) {
		return request('updateAirInfo.do', data, 'post')
	},
	// 获取菜单树选择器
	mobileMenuTreeSelector(data) {
		return request('menuTreeSelector', data, 'get')
	},
	// 启用空投活动
	enableAirInfo(airId) {
		return request(`${airId}/enableAirInfo.do`, {}, 'get')
	},
	// 停用空投活动
	disableAirInfo(airId) {
		return request(`${airId}/disableAirInfo.do`, null, 'get')
	},
	// 分页查询空投记录
	pageAirLog(pageNo, pageSize, data) {
		return request(`${pageNo}/${pageSize}/pageAirLog.do`, data, 'post')
	},
	// 查询空投执行记录
	getAirExeLogList(airId) {
		return request(`${airId}/getAirExeLogList.do`, null, 'get')
	},
}
